package meterMonitor.mapper;

import meterMonitor.model.Meter;
import meterMonitor.vo.*;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface MeterToolsMapper {
    List<MeterTools> sel();

    Meter getModByCode(@Param(value = "meterCode") String meterCode);

    int updateCurrentQuantiry(@Param(value = "currentQuantiry") double currentQuantiry, @Param(value = "deviceName") String deviceName);

    MonitorAll getMonitorToday(@Param(value = "meterCode") String meterCode, @Param(value = "uploadDate") String uploadDate);

    MonitorAll getMonitorBef(@Param(value = "meterCode") String meterCode, @Param(value = "uploadDate") String uploadDate);

    int updCurrentQuantiryIntervalQuantity(@Param(value = "currentQuantiry") double currentQuantiry, @Param(value = "intervalQuantity") double intervalQuantity, @Param(value = "PKID") Integer PKID);

    MonitorDetailAll getDetailToday(@Param(value = "meterCode") String meterCode, @Param(value = "uploadDate") String uploadDate);

    MonitorDetailAll getDetailBef(@Param(value = "meterCode") String meterCode, @Param(value = "PKID") Integer PKID);

    int updDetailToday(@Param(value = "currentQuantiry") double currentQuantiry, @Param(value = "intervalQuantity") double intervalQuantity, @Param(value = "receiveIntervalQuantity") double receiveIntervalQuantity, @Param(value = "PKID") Integer PKID);

    MonitorHourAll getHourLatest(@Param(value = "meterCode") String meterCode, @Param(value = "uploadDate") String uploadDate);

    MonitorHourAll getHourBef(@Param(value = "meterCode") String meterCode, @Param(value = "PKID") Integer PKID);

    int updHour(@Param(value = "currentQuantiry") double currentQuantiry, @Param(value = "intervalQuantity") double intervalQuantity, @Param(value = "PKID") Integer PKID);

    int monitorInsert(MonitorAll monitorAll);

    MonitorHourAll getMonitorHourToday(@Param(value = "meterCode") String meterCode);

    int monitorHourInsert(MonitorHourAll monitorHourAll);

    MonitorDetailAll monitorDetailLatest(String meterCode);

    int monitorDetailInsert(MonitorDetailAll monitorDetailAll);

    List<MonitorAll> getMonitorByUploadDate(String uploadDate);

    List<MonitorAll> getMonitorBymeterCode(String meterCode);

    List<MeterStatus> getMeterStatusAll(String uploadDate);

}
